package com.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * <code>DemoController</code>
 * </p>
 *
 * @author junbao3
 * TODO
 * @date 2023-04-04 10:26
 * Copyright (C) 2021 IFlyTek. All rights reserved.
 */
@RestController
public class DemoController {
    @Autowired
    private DemoService demoService;

    //这个方法就是使用tomcat线程池里面的线程去执行的
    //这个方法就相当于是tomcat线程池的任务
    @GetMapping("/test")
    public String test() throws InterruptedException {
        Thread.sleep(2000);
        return demoService.test();
    }
}
